package gui;

import java.awt.Color;
import java.awt.GridLayout;

import javax.swing.JPanel;
import javax.swing.JTextPane;
import javax.swing.text.BadLocationException;
import javax.swing.text.SimpleAttributeSet;
import javax.swing.text.StyleConstants;
/**
 * Gestor de el manel de el "norte"
 */
public class PanelNorte extends JPanel{
	private PanelMenu menu;
	private PanelBC bc;
	private int num_art;
	/**
	 * @return menu
	 */
	public PanelMenu getMenu() {
		return menu;
	}
	/**
	 * @param menu
	 */
	public void setMenu(PanelMenu menu) {
		this.menu = menu;
	}
	/**
	 * @return bc
	 */
	public PanelBC getBc() {
		return bc;
	}
	/**
	 * @param bc
	 */
	public void setBc(PanelBC bc) {
		this.bc = bc;
	}
	/**
	 * Constructor del PanelNorte
	 * @param num_art numero de articulos en la cesta
	 */
	public PanelNorte(int num_art){
		this.num_art=num_art;
		GridLayout layout = new GridLayout(0,1);
		layout.setHgap(5); layout.setVgap(5);
		this.setLayout(layout);
		JPanel panel= new JPanel();
		panel.setLayout(new GridLayout(2,0));
		JTextPane tienda= new JTextPane();
		SimpleAttributeSet atb= new SimpleAttributeSet();
		StyleConstants.setBold(atb,  true); //negrita
		StyleConstants.setFontSize(atb, 50);
		StyleConstants.setBackground(atb, new Color(0xEEEEEE));
		try {
			tienda.getStyledDocument().insertString(tienda.getStyledDocument().getLength(),"    ---TIENDA DE ZAPATILLAS DEPORTIVAS---    ", atb);
		} catch (BadLocationException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		menu= new PanelMenu();
		bc=new PanelBC(num_art);
		panel.add(tienda);
		panel.add(bc);
		//this.add(tienda);
		//this.add(bc);
		this.add(panel);
		this.add(menu);
		
		
		
	}

}
